package com.xrkj.miniprogram.server.service;

import com.xrkj.miniprogram.server.entity.DigitalDevice;
import com.xrkj.miniprogram.server.mapper.DigitalDeviceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@SuppressWarnings("")
public class LongitudeAndLatitudeService {
    @Autowired
    DigitalDeviceMapper deviceMapper;

    @Transactional
    public void updateLongitudeAndLatitude(int id,double longitude,double latitude){
        DigitalDevice updateingDevice=deviceMapper.selectById(id);
        updateingDevice.setLongitude(new Double(longitude).floatValue());
        updateingDevice.setLatitude(new Double(latitude).floatValue());
        deviceMapper.updateById(updateingDevice);
    }


}
